#ifndef  __M_MSG_H__
#define  __M_MSG_H__

/*日志信息*/
#include <iostream>
#include <thread>
#include <string>
#include "util.hpp"
#include "level.hpp"

namespace log
{
    class LogMessage
    {
    public:
        time_t _ctime;//日志产生的时间戳
        LogLevel::value _level;//日志等级
        size_t _line;//行号
        std::thread::id _tid;//线程id
        std::string _filename;//文件名
        std::string _logger;//日志器名称
        std::string _payload;//有效消息数据
    public:
        LogMessage(LogLevel::value level,size_t line,
        const std::string filename,
        const std::string logger,
        const std::string msg)
        :_ctime(log::util::Date::getTime()),
        _level(level),
        _line(line),
        _tid(std::this_thread::get_id()),
        _filename(filename),
        _logger(logger),
        _payload(msg){}
    };
}

#endif